
package combat.dudes.protocol.data;

import gnu.cajo.invoke.Remote;

import java.rmi.RemoteException;
import java.util.ArrayList;


/**
 * This file has been created to ease the typecasting from ArrayList<Object> to ArrayList<Remote>.
 * 
 * Now, instead of a for-loop...
 * ---- (Simulation.java)
 * public RemoteList getTeams() {
 * ArrayList<Remote> teamsRemote = new ArrayList<Remote>();
 * for(TeamInt team : teams) try { teamsRemote.add(new Remote(team)); } catch(RemoteException e) {}
 * return teamsRemote;
 * }
 * ----
 * 
 * ... you can simply write the following if you want a filled ArrayList<Remote>:
 * ---- (Simulation.java)
 * public RemoteList getTeams() {
 * return new RemoteList(teams);
 * }
 * ----
 * @author Laurens Andriessen
 * @version 1.0
 */
public class RemoteList extends ArrayList<Remote> {

	private static final long serialVersionUID = 1L;

	public RemoteList() {}

	public RemoteList(ArrayList list) throws RemoteException {
		for(Object tmp : list)
			this.add(new Remote(tmp));
	}

}
